package org.TCPcase1;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket=new ServerSocket(10086);
        Socket accept = serverSocket.accept();
        while (true) {
            BufferedReader br=new BufferedReader(new  InputStreamReader(accept.getInputStream()));
            String s = br.readLine();
            System.out.println(s);
            if (s.equals("关闭")){
                break;
            }
        }
        accept.close();
        serverSocket.close();
    }
}
